package org.example.controller;

import jakarta.annotation.Resource;
import org.example.service.AccountService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/acc")
public class accController {
    @Resource
    private AccountService accountService;
    @GetMapping("/debit")
    public String debit(@RequestParam("userId") String userId,@RequestParam("money") int money) {
        accountService.debit(userId, money);
        return "success";
    }
}
